home *** CD-ROM | disk | FTP | other *** search
- '******************************************************************'
- '* *'
- '* TurboCAD for Windows *'
- '* Copyright (c) 1993 - 2004 *'
- '* International Microcomputer Software, Inc. *'
- '* (IMSI) *'
- '* All rights reserved. *'
- '* *'
- '******************************************************************'
- Public Class frmRRect
- Inherits System.Windows.Forms.Form
-
- #Region " Windows Form Designer generated code "
-
- Public Sub New()
- MyBase.New()
-
- 'This call is required by the Windows Form Designer.
- InitializeComponent()
-
- 'Add any initialization after the InitializeComponent() call
- cModesCombo.Items.Add("Horizontal")
- cModesCombo.Items.Add("Vertical")
- cModesCombo.Items.Add("ForwardDiagonal")
- cModesCombo.Items.Add("BackwardDiagonal")
- cModesCombo.SelectedIndex = 0
- rRect = New Drawing.Rectangle(0, 0, picPreview.Width, picPreview.Height)
- bMode = Drawing.Drawing2D.LinearGradientMode.Horizontal
-
- bCanceled = True
- bShowPreview = True
- End Sub
-
- 'Form overrides dispose to clean up the component list.
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.IContainer
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- Friend WithEvents picPreview As System.Windows.Forms.PictureBox
- Friend WithEvents cmOK As System.Windows.Forms.Button
- Friend WithEvents cmCancel As System.Windows.Forms.Button
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents ColorDialog1 As System.Windows.Forms.ColorDialog
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents cmColor1 As System.Windows.Forms.Panel
- Friend WithEvents cmColor2 As System.Windows.Forms.Panel
- Friend WithEvents Label4 As System.Windows.Forms.Label
- Friend WithEvents cModesCombo As System.Windows.Forms.ComboBox
- Friend WithEvents Label5 As System.Windows.Forms.Label
- Friend WithEvents tbRoundness As System.Windows.Forms.TextBox
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.picPreview = New System.Windows.Forms.PictureBox
- Me.cmOK = New System.Windows.Forms.Button
- Me.cmCancel = New System.Windows.Forms.Button
- Me.Label1 = New System.Windows.Forms.Label
- Me.ColorDialog1 = New System.Windows.Forms.ColorDialog
- Me.cmColor1 = New System.Windows.Forms.Panel
- Me.Label2 = New System.Windows.Forms.Label
- Me.Label3 = New System.Windows.Forms.Label
- Me.cmColor2 = New System.Windows.Forms.Panel
- Me.cModesCombo = New System.Windows.Forms.ComboBox
- Me.Label4 = New System.Windows.Forms.Label
- Me.tbRoundness = New System.Windows.Forms.TextBox
- Me.Label5 = New System.Windows.Forms.Label
- Me.SuspendLayout()
- '
- 'picPreview
- '
- Me.picPreview.BackColor = System.Drawing.Color.Transparent
- Me.picPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.picPreview.Location = New System.Drawing.Point(248, 48)
- Me.picPreview.Name = "picPreview"
- Me.picPreview.Size = New System.Drawing.Size(168, 144)
- Me.picPreview.TabIndex = 0
- Me.picPreview.TabStop = False
- '
- 'cmOK
- '
- Me.cmOK.Location = New System.Drawing.Point(320, 232)
- Me.cmOK.Name = "cmOK"
- Me.cmOK.Size = New System.Drawing.Size(80, 24)
- Me.cmOK.TabIndex = 1
- Me.cmOK.Text = "OK"
- '
- 'cmCancel
- '
- Me.cmCancel.Location = New System.Drawing.Point(224, 232)
- Me.cmCancel.Name = "cmCancel"
- Me.cmCancel.Size = New System.Drawing.Size(80, 24)
- Me.cmCancel.TabIndex = 1
- Me.cmCancel.Text = "Cancel"
- '
- 'Label1
- '
- Me.Label1.Location = New System.Drawing.Point(240, 8)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(168, 24)
- Me.Label1.TabIndex = 2
- Me.Label1.Text = "Preview: "
- '
- 'cmColor1
- '
- Me.cmColor1.BackColor = System.Drawing.SystemColors.Desktop
- Me.cmColor1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.cmColor1.Location = New System.Drawing.Point(104, 53)
- Me.cmColor1.Name = "cmColor1"
- Me.cmColor1.Size = New System.Drawing.Size(96, 24)
- Me.cmColor1.TabIndex = 4
- '
- 'Label2
- '
- Me.Label2.Location = New System.Drawing.Point(8, 56)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(88, 16)
- Me.Label2.TabIndex = 5
- Me.Label2.Text = "Start Color:"
- '
- 'Label3
- '
- Me.Label3.Location = New System.Drawing.Point(8, 104)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(88, 16)
- Me.Label3.TabIndex = 5
- Me.Label3.Text = "End Color:"
- '
- 'cmColor2
- '
- Me.cmColor2.BackColor = System.Drawing.SystemColors.Desktop
- Me.cmColor2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.cmColor2.Location = New System.Drawing.Point(104, 99)
- Me.cmColor2.Name = "cmColor2"
- Me.cmColor2.Size = New System.Drawing.Size(96, 24)
- Me.cmColor2.TabIndex = 4
- '
- 'cModesCombo
- '
- Me.cModesCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
- Me.cModesCombo.Location = New System.Drawing.Point(104, 144)
- Me.cModesCombo.Name = "cModesCombo"
- Me.cModesCombo.Size = New System.Drawing.Size(96, 21)
- Me.cModesCombo.TabIndex = 7
- '
- 'Label4
- '
- Me.Label4.Location = New System.Drawing.Point(8, 144)
- Me.Label4.Name = "Label4"
- Me.Label4.Size = New System.Drawing.Size(88, 16)
- Me.Label4.TabIndex = 5
- Me.Label4.Text = "Mode:"
- '
- 'tbRoundness
- '
- Me.tbRoundness.Location = New System.Drawing.Point(104, 192)
- Me.tbRoundness.Name = "tbRoundness"
- Me.tbRoundness.Size = New System.Drawing.Size(96, 20)
- Me.tbRoundness.TabIndex = 8
- Me.tbRoundness.Text = "0"
- '
- 'Label5
- '
- Me.Label5.Location = New System.Drawing.Point(8, 194)
- Me.Label5.Name = "Label5"
- Me.Label5.Size = New System.Drawing.Size(88, 16)
- Me.Label5.TabIndex = 5
- Me.Label5.Text = "Roundness:"
- '
- 'frmRRect
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
- Me.ClientSize = New System.Drawing.Size(432, 273)
- Me.Controls.Add(Me.tbRoundness)
- Me.Controls.Add(Me.cModesCombo)
- Me.Controls.Add(Me.Label2)
- Me.Controls.Add(Me.cmColor1)
- Me.Controls.Add(Me.Label1)
- Me.Controls.Add(Me.cmOK)
- Me.Controls.Add(Me.picPreview)
- Me.Controls.Add(Me.cmCancel)
- Me.Controls.Add(Me.Label3)
- Me.Controls.Add(Me.cmColor2)
- Me.Controls.Add(Me.Label4)
- Me.Controls.Add(Me.Label5)
- Me.Name = "frmRRect"
- Me.Text = "FormRect"
- Me.ResumeLayout(False)
-
- End Sub
-
- #End Region
- Dim Grs As Drawing.Graphics
- Dim LB As Drawing.Drawing2D.LinearGradientBrush
- Dim rRect As Drawing.Rectangle
- Dim bMode As Drawing.Drawing2D.LinearGradientMode
- Dim bShowPreview As Boolean
- Public bCanceled As Boolean
- Private Sub cmCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmCancel.Click
- bCanceled = True
- LB = Nothing
- Me.Close()
- End Sub
-
- Private Sub cmColor1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmColor1.Click
- Dim Clr As Drawing.Color
- ColorDialog1.ShowDialog(Me)
- Clr = ColorDialog1.Color
- cmColor1.BackColor = Clr
- bShowPreview = False
- LB = Nothing
- LB = New Drawing.Drawing2D.LinearGradientBrush(rRect, cmColor1.BackColor, cmColor2.BackColor, bMode)
- bShowPreview = True
-
- picPreview.Refresh()
- End Sub
- Private Sub cmColor2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmColor2.Click
- Dim Clr As Drawing.Color
- ColorDialog1.ShowDialog(Me)
- Clr = ColorDialog1.Color
- cmColor2.BackColor = Clr
- bShowPreview = False
- LB = Nothing
- LB = New Drawing.Drawing2D.LinearGradientBrush(rRect, cmColor1.BackColor, cmColor2.BackColor, bMode)
- bShowPreview = True
-
- picPreview.Refresh()
- End Sub
-
-
- Private Sub picPreview_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles picPreview.Paint
- If bShowPreview Then
- If LB Is Nothing Then
- LB = New Drawing.Drawing2D.LinearGradientBrush(rRect, cmColor1.BackColor, cmColor2.BackColor, bMode)
- End If
- e.Graphics.FillRectangle(LB, rRect)
- End If
- End Sub
-
- Private Sub cModesCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cModesCombo.SelectedIndexChanged
- Dim bNewMode As Drawing.Drawing2D.LinearGradientMode
- bNewMode = bMode
- Select Case cModesCombo.SelectedItem.ToString()
- Case "Horizontal"
- bNewMode = Drawing.Drawing2D.LinearGradientMode.Horizontal
- Exit Select
- Case "Vertical"
- bNewMode = Drawing.Drawing2D.LinearGradientMode.Vertical
- Exit Select
- Case "ForwardDiagonal"
- bNewMode = Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal
- Exit Select
- Case "BackwardDiagonal"
- bNewMode = Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal
- Exit Select
- End Select
- If bMode <> bNewMode Then
- bShowPreview = False
- LB = Nothing
- LB = New Drawing.Drawing2D.LinearGradientBrush(rRect, cmColor1.BackColor, cmColor2.BackColor, bNewMode)
- bShowPreview = True
- picPreview.Refresh()
- bMode = bNewMode
- End If
-
- End Sub
-
- Private Sub cmOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmOK.Click
- bCanceled = False
- LB = Nothing
- Me.Hide()
- End Sub
- End Class
-